package com.xq.sqlSession;


import com.xq.config.XMLConfigBuilder;
import com.xq.pojo.Configuration;

import java.io.InputStream;

//用于生产sqlsessionfactory
public class SqlSessionFactoryBuilder {

    public SqlSessionFactory build(InputStream inputStream) throws Exception {

        //dom4j解析configuration
        XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder();

        Configuration configuration = xmlConfigBuilder.paresConfig(inputStream);

        return new DefaultSqlSessionFactory(configuration);

    }
}
